cmake_minimum_required(VERSION 3.5)

project(qplanetosm_designer VERSION 1.0 LANGUAGES CXX)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)


find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets Designer REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets Designer  REQUIRED)

set(PRJ_HEADERS
    osm_designer_plugin.h
    qtwidget_planetosm_designer_global.h
)

set(PRJ_SOURCES
    osm_designer_plugin.cpp
)
add_library(qplanetosm_designer SHARED
    ${PRJ_HEADERS}
    ${PRJ_SOURCES}
)
target_compile_definitions(qplanetosm_designer PRIVATE QTWIDGET_PLANETOSM_DESIGNER_LIBRARY)
target_link_libraries(qplanetosm_designer PRIVATE
    qplanetosm_widget
    Qt${QT_VERSION_MAJOR}::Widgets
    Qt${QT_VERSION_MAJOR}::Designer

)
